package cn.xfdzx.android.apps.shop.model;


import java.util.Map;

import cn.xfdzx.android.apps.shop.bean.BaseObjectBean;
import cn.xfdzx.android.apps.shop.bean.ConfirmGoodBeen;
import cn.xfdzx.android.apps.shop.bean.HomeSearchXFDGoodBeen;
import cn.xfdzx.android.apps.shop.bean.MoreGoodsBean;
import cn.xfdzx.android.apps.shop.bean.ShopCarListBeen;
import cn.xfdzx.android.apps.shop.bean.ShopGoodListBeen;
import cn.xfdzx.android.apps.shop.bean.ShopSearchBeen;
import cn.xfdzx.android.apps.shop.bean.StoreInfoBeen;
import cn.xfdzx.android.apps.shop.bean.XFDGoodsDetailsBeen;
import cn.xfdzx.android.apps.shop.contract.ShopRetailContract;
import cn.xfdzx.android.apps.shop.contract.ShopSearchContract;
import cn.xfdzx.android.apps.shop.net.RetrofitClient;
import io.reactivex.Flowable;

/**
 * @author azheng
 * @date 2018/6/4.
 * Description：
 */
public class ShopSearchModel implements ShopSearchContract.Model {


    @Override
    public Flowable<ShopSearchBeen> initSearchData(String lng, String lat,String sid, String page, String limit, String index_status, String is_store, String store_id, String keyword, String priceOrder, String salesOrder, String news) {
        return RetrofitClient.getInstance().getApi().shopSearch(lng,lat,sid,  page,  limit,  index_status,  is_store,  store_id,  keyword,  priceOrder,  salesOrder,  news);
    }


    @Override
    public Flowable<ConfirmGoodBeen> addCar(String is_new, String uniqueId, String productId, String cartNum) {
        return  RetrofitClient.getInstance().getApi().confirmGood(is_new,uniqueId,productId,cartNum);
    }

    @Override
    public Flowable<ShopCarListBeen> shopCarList(String store_id, String index_status) {
        return RetrofitClient.getInstance().getApi().shopCarList(store_id,index_status);
    }


    @Override
    public Flowable<BaseObjectBean> updateCarNum(String id, String number) {
        return RetrofitClient.getInstance().getApi().updateCartNum(id,number);
    }

    @Override
    public Flowable<BaseObjectBean> removeGood(String ids) {
        return RetrofitClient.getInstance().getApi().removeGood(ids);
    }

    @Override
    public Flowable<ConfirmGoodBeen> confirm(String  cartId,String  user_curent_lng,String  user_curent_lat) {
        return RetrofitClient.getInstance().getApi().confirm(cartId,user_curent_lng,user_curent_lat);
    }

}
